<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ti_advpara.*" %>
<%@page import="java.util.*" %>
<%
	Ti_advpara ti_advpara = new Ti_advpara();
	String _pos_name = "",s_adv_type="";

	
	if(request.getParameter("n_pos_name")!=null && !request.getParameter("n_pos_name").equals("")){
		_pos_name = request.getParameter("n_pos_name");
		ti_advpara.setPos_name(_pos_name);
	}
	
		if(request.getParameter("adv_type")!=null && !request.getParameter("adv_type").equals("")){
		s_adv_type = request.getParameter("adv_type");
		ti_advpara.setAdv_type(s_adv_type);
	}

	String iStart = "0";
	int limit = 20;
	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");
	String para =	"/program/admin/advpara/index.jsp?n_pos_name="+_pos_name+"&adv_type="+s_adv_type+"&iStart="+Integer.parseInt(iStart)+"&limit="+limit;

%>
<html>
  <head>
    
    <title>广告位管理</title>
    
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script language="javascript" type="text/javascript" src="js_advpara.js"></script>

</head>

<body>

  <% 
  	String pos_id="";
  	if(request.getParameter("pos_id")!=null) pos_id = request.getParameter("pos_id");
  	Ti_advparaInfo ti_advparaInfo = new Ti_advparaInfo();
  	List list = ti_advparaInfo.getListByPk(pos_id);
  	Hashtable map = new Hashtable();
  	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
  	
  	String cust_id="",adv_type="",pos_name="",content="",pos_num="",word_num="",price="",page_url="",no_show="",state_code="",user_id="",in_date="",remark="";
  	if(map.get("cust_id")!=null) cust_id = map.get("cust_id").toString();
  	if(map.get("adv_type")!=null) adv_type = map.get("adv_type").toString();
  	if(map.get("pos_name")!=null) pos_name = map.get("pos_name").toString();
  	if(map.get("content")!=null) content = map.get("content").toString();
  	if(map.get("pos_num")!=null) pos_num = map.get("pos_num").toString();
  	if(map.get("word_num")!=null) word_num = map.get("word_num").toString();
  	if(map.get("price")!=null) price = map.get("price").toString();
  	if(map.get("page_url")!=null) page_url = map.get("page_url").toString();
  	if(map.get("no_show")!=null) no_show = map.get("no_show").toString();
  	if(map.get("state_code")!=null) state_code = map.get("state_code").toString();
  	if(map.get("user_id")!=null) user_id = map.get("user_id").toString();
  	if(map.get("in_date")!=null) in_date = map.get("in_date").toString();
  	if(map.get("remark")!=null) remark = map.get("remark").toString();
  	
  String _in_date=new Date().toLocaleString();
  %>
	
	<h1>修改广告位</h1>
	<form action="/doTradeReg.do" method="post" name="addForm">
		
	<table width="100%" cellpadding="1" cellspacing="1" class="listtab" border="0">
		<tr>
			<td align="right" width="10%">
				广告位名称<font color="#ff0000">*</font>
			</td>
			<td colspan="3" style="padding-left:15px;">
			<input name="pos_name" id="pos_name" value="<%=pos_name%>" style="width:200px;" type="text" maxLength="50"/></td>
		</tr>
		
		
		
		
	<tr>
		  <td  align="right" width="15%">
				广告位类型<font color="#ff0000">*</font>
			<td align="left" width="20%">
			
			<select name="adv_type" id="adv_type" style="width:200px;">
						<option value="">请选择</option>
						<option value="0" <%if(adv_type.equals("0")) out.print("selected");%>>文字</option>
						<option value="1" <%if(adv_type.equals("1"))out.print("selected");%>>图片</option>
						<option value="2" <%if(adv_type.equals("2")) out.print("selected");%>>图文</option>
					</select>
			</td>
			
			<td align="right" width="10%">
				数量限制:
			</td align="left" width="21%">
			<td>
			
				<input name="pos_num" id="pos_num" size="6" value="<%=pos_num%>" type="text" maxLength="5" onBlur="Num()"/>
			
			</td>
			</tr>
			   <tr>
			<td align="right" width="15%">
				文字限制:
			 <td align="left">
				
			 <input name="word_num" id="word_num" style="width:200px;" value="<%=word_num%>" type="text" maxLength="35" onBlur="Num()"/></td>		 
				
				<td align="right" width="10%">
				价格<font color="#ff0000">*</font>
			<td colspan="3">
			
				<input name="price" id="price" maxLength="19" value="<%=price%>" size="17" type="text" onBlur="Num()" />&nbsp;元/天</td>
					 
					 
			</td>
		</tr>	
	
		<tr>
			<td align="right" width="15%">
					页面地址:
			</td>
			<td colspan="3" style="padding-left:15px;"><input name="page_url" id="page_url" style="width:330px;" value="<%=page_url%>" maxLength="300" type="text" onBlur="IsURL()"/></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				无广告时显示:
			</td>
			<td colspan="3" style="padding-left:15px;">
				 <textarea name="no_show" id="no_show" cols="50" rows="6" onKeyUp="if(this.value.length > 300) this.value=this.value.substr(0,300)" ><%=no_show%></textarea>
			</td>
		</tr>
		
		
		<tr>
			<td align="right" width="10%">
				广告位描述:
			</td>
			<td colspan="3" style="padding-left:15px;">
				
			<textarea name="content" id="content" cols="50" rows="6" onKeyUp="if(this.value.length > 300) this.value=this.value.substr(0,300)" ><%=content%></textarea>
			
				
				</td>
		</tr>
		
	

	</table>
		<input name="in_date" id="in_date" type="hidden" value="<%=_in_date%>" />
	<input name="state_code" id="state_code" type="hidden" value="0"/>
	<input name="user_id" id="user_id" type="hidden" value="<%=user_id%>"/>
	<input name="pos_id" id="pos_id" type="hidden" value="<%=pos_id%>"/>
	<input name="cust_id" id="cust_id" type="hidden" value="<%=cust_id%>"/>
	
	<input name="remark" id="remark" type="hidden" value=""	/>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="jumpurl" value="<%=para%>" />
				<input type="hidden" name="bpm_id" value="0470" />
	  		<input type="hidden" name="pos_id" value="<%=pos_id %>" />
				<input class="buttoncss" type="button" name="tradeSub" id="tradeSub" value="提交" onclick="subForm()"/>&nbsp;&nbsp;
				<input class="buttoncss" type="button" name="tradeRut" value="返回" onclick="window.location.href='<%=para%>';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
